package com.sunrise.xdoc.entity.operator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sunrise.xdoc.entity.AbstractCodeEntity;
import com.sunrise.xdoc.entity.config.ChiNhanh;

@Entity
@Table(name = "op_operator_profile")
@Inheritance(strategy = InheritanceType.JOINED)
public class OperatorProfile extends AbstractCodeEntity {
	private static final long serialVersionUID = -8354763453284069900L;
	private ChiNhanh chiNhanh;
	private String name;
	private boolean active = false;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "chi_nhanh_id")
	public ChiNhanh getChiNhanh() {
		return chiNhanh;
	}

	public void setChiNhanh(ChiNhanh chiNhanh) {
		this.chiNhanh = chiNhanh;
	}

	@Column(name = "name", length = 128)
	@NotNull
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "active")
	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

}
